﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TotalApplication.C__Comic.fileStream
{
    public static class FileStreamRV
    {
        public static string GetFileStreamRV(string filePath)
        {
            if (string.IsNullOrEmpty(filePath))
                return "文件路径不能为空";
            try
            {
                using (var fileStream = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                {
                    byte[] buffer = new byte[1024];
                    int bytesRead = fileStream.Read(buffer, 0, buffer.Length);
                    return $"读取了 {bytesRead} 字节";
                }
            }
            catch (Exception ex)
            {
                return $"错误: {ex.Message}";
            }
        }
    }
}
